﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FileSynchronization.Helpers
{
    public static class PageHelper
    {
        public static IEnumerable<List<T>> Split<T>(List<T> list, int pagesize)
        {
            var page = (int)Math.Ceiling(list.Count / (float)pagesize);
            for (int i = 0; i < page; i++) 
            {
                yield return list.Skip(i * pagesize).Take(pagesize).ToList();
            }
        }
    }
}
